package logic

import (
	"context"

	"go-zero-mall/app/product/cmd/rpc/internal/svc"
	"go-zero-mall/app/product/cmd/rpc/pb"

	"github.com/zeromicro/go-zero/core/logx"
)

type PmsProductAttributeInfoDeleteLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewPmsProductAttributeInfoDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PmsProductAttributeInfoDeleteLogic {
	return &PmsProductAttributeInfoDeleteLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *PmsProductAttributeInfoDeleteLogic) PmsProductAttributeInfoDelete(in *pb.PmsProductAttributeInfoDeleteReq) (*pb.PmsProductAttributeInfoDeleteResp, error) {
	err := l.svcCtx.PmsProductAttributeModel.Delete(l.ctx, in.Id)
	if err != nil {
		return nil, err
	}
	return &pb.PmsProductAttributeInfoDeleteResp{}, nil
}
